package org.aristotle.auth.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.security.oauth2.provider.token.store.KeyStoreKeyFactory;

import java.security.KeyPair;

@Configuration
public class RSAKeyConfig {

    @Bean
    public KeyPair keyPair() {
        KeyStoreKeyFactory factory = new KeyStoreKeyFactory(new ClassPathResource("aristotle.jks"), "123456".toCharArray());
        KeyPair keyPair = factory.getKeyPair("aristotle", "123456".toCharArray());
        return keyPair;
    }



}
